Repository navigation
HDDS-15209. Stabilize TestRocksDBCheckpointDiffer#testDifferWithDB for RocksDB layout variance - #10890
HDDS-15209. Stabilize TestRocksDBCheckpointDiffer#testDifferWithDB for RocksDB layout variance#10890jojochuang wants to merge 2 commits into
Conversation
Wait for in-flight compactions before diff assertions. Validate snapshot metadata diffs independently, verify DAG subset filtering against the full DAG diff, fail fast when getSSTDiffList returns empty Optional, and assert SST backups using first-to-last diff vs snapshot/backup dir (per review). Remove @flaky. Co-authored-by: Cursor <cursoragent@cursor.com> Change-Id: Icb1b4f87c93d317a860c10d64a35c62227ce5101
Co-authored-by: Cursor <cursoragent@cursor.com> Change-Id: I42a3c7da8f0c1872d860f88fba3456c1175b79c8
There was a problem hiding this comment.
Pull request overview
Stabilizes TestRocksDBCheckpointDiffer#testDifferWithDB in the rocksdb-checkpoint-differ module by reducing dependence on RocksDB’s non-deterministic SST numbering/compaction shape and by adding stronger synchronization and derived “oracle” checks.
Changes:
- Removes the
@Flakymarker and waits for in-flight compactions to drain before DAG-based assertions. - Reworks snapshot diff verification to (a) validate non-DAG diffs against an independently computed snapshot-metadata diff and (b) validate subset DAG diffs against a “full tables” DAG diff baseline.
- Replaces the prior fixed backup-link expectations with a new helper assertion around SST backup contents.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| Set<String> backupBaseNames; | ||
| try (Stream<Path> sstPathStream = Files.list(sstBackUpDir.toPath())) { | ||
| backupBaseNames = sstPathStream.map(path -> getBaseName(path.getFileName().toString())) | ||
| .collect(Collectors.toSet()); | ||
| assertThat(backupBaseNames).isNotEmpty(); | ||
| assertThat(backupBaseNames).allMatch(name -> name.matches("\\d+")); | ||
| } |
arunsarin85
left a comment
There was a problem hiding this comment.
+1 LGTM.
Thanks for addressing the review comments and rebasing on current master.
Closing my stale #10363 in favor of this PR for merge.
| new DifferSnapshotVersion(src, 0, allTables), | ||
| new DifferSnapshotVersion(snap, 0, allTables), | ||
| null, allTables, false).orElse(Collections.emptyList()); | ||
| assertThat(metadataDiffViaApi).containsExactlyInAnyOrderElementsOf(metadataDiff); |
There was a problem hiding this comment.
Is this oracle independent of the code under test? buildNonDagMetadataDiff (L1089) does the symmetric diff of getSstFiles(0, tables), and the useCompactionDag=false branch it's checked against (getSSTDiffList, main L830-846) does the same diff over the same getSstFiles(0, tables) with the same SstFileInfo.equals — so both sides move together and a matching bug still passes. It also never exercises the compaction DAG. Diff against an independent source, or drop it and rely on the DAG-path checks?
| assertThat(backupBaseNames).isNotEmpty(); | ||
| assertThat(backupBaseNames).allMatch(name -> name.matches("\\d+")); | ||
| } | ||
| for (SstFileInfo diffFile : diffSinceFirst) { | ||
| String fileName = diffFile.getFileName(); | ||
| assertTrue(lastSnapshotFileNames.contains(fileName) || backupBaseNames.contains(fileName), |
There was a problem hiding this comment.
Weaker than what it replaces (master: exactly 7 links, \d{6}\.sst). Relaxing \d{6}→\d+ is fair (SST number width varies), but isNotEmpty drops the count, and lastSnapshotFileNames.contains(f) || backupBaseNames.contains(f) is met by the last-snapshot branch alone — it'd pass even if the backup dir were near-empty. Keep a lower-bound count and assert the backup dir actually holds the DAG-diff SSTs?
rich7420
left a comment
There was a problem hiding this comment.
@jojochuang thanks for the patch
|
This PR has been marked as stale due to 21 days of inactivity. Please comment or remove the stale label to keep it open. Otherwise, it will be automatically closed in 7 days. |
|
Thank you for your contribution. This PR is being closed due to inactivity. Please contact a maintainer if you would like to reopen it. |
Wait for in-flight compactions before diff assertions, fail fast when getSSTDiffList returns empty Optional, verify DAG subset filtering against the full-table DAG diff, and assert SST backups hold compacted-away files. Remove @flaky. Revives apache#10890 on current master, addressing review feedback to keep the independent self-diff oracle and strengthen backup assertions.
Summary
Revives HDDS-15209 / replaces conflicted head on #10363 with a branch merged to current
master.TestRocksDBCheckpointDiffer#testDifferWithDB(no@Flaky, wait for in-flight compactions, independent metadata diff oracle, DAG subset checks, SST backup assertions).master(includes prior partial HDDS-15209 hardening on backup link checks).Jira
https://issues.apache.org/jira/browse/HDDS-15209
Test plan
mvn -pl :rocksdb-checkpoint-differ test -Dtest=TestRocksDBCheckpointDiffer./hadoop-ozone/dev-support/checks/pmd.shSupersedes conflict resolution for #10363 (head still on outdated
arunsarin85:HDDS-15209).Made with Cursor